<?php
require_once('../phplib/include.inc.php');

class ModifyProduct extends PageBase{
	public  function ParseRequest(){		
		if(!isset($_REQUEST['pid'])) PageBase::Error('非法访问.');
		$pid = intval($_REQUEST['pid']);
		Util::HaveRight_Or(array(1,$pid*10+1));
		$db = getDb();
		$db->connect();
		$product = $db->fetchOne("SELECT * FROM product_t WHERE pid=$pid");
		if($product == null) PageBase::Error('没有找到该焊接数据.');
		$this->assign('product',$product);
	}
	public function Ini(){
		$this->GetTypes();
		global $WeldSetting;
		$this->assign('hscls',$WeldSetting['hscl']);
		$this->assign('czmss',$WeldSetting['czms']);
		$this->assign('hszjs',$WeldSetting['hszj']);
		$this->assign('bhqts',$WeldSetting['bhqt']);
	}
	public function GetTypes(){
		$db = getDb();
		$db->connect();
		$types = $db->fetch("SELECT * FROM type_t");
		$this->assign('types',$types);
	}
}
$modifyproduct = new ModifyProduct("file:".dirname(__FILE__)."/../home/modifyproduct.tpl.html");
$modifyproduct->display();
?>